package com.neuedu.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neuedu.dao.NewsDao;
import com.neuedu.model.News;
import com.neuedu.service.NewsService;

@Service
public class NewsServiceImpl implements NewsService {

	// 依赖注入
	@Autowired
	private NewsDao NewsDao;
	
	public void setNewsDao(NewsDao NewsDao) {
		this.NewsDao = NewsDao;
	}
	
	@Override
	public int countNews() {
		return NewsDao.countNews();
	}

	@Override
	public List<News> findAll(Map<String, Object> map) {
		return NewsDao.findAll(map);
	}

	@Override
	public int addNews(News u) {
		return NewsDao.addNews(u);
	}

	@Override
	public int updateNews(News u) {
		return NewsDao.updateNews(u);
	}

	@Override
	public int deleteNews(int id) {
		return NewsDao.deleteNews(id);
	}

	@Override
	public News findOne(int id) {
		// TODO Auto-generated method stub
		return NewsDao.findOne(id);
	}

}